#include "optionsview.h"
#include "ui_optionsview.h"

OptionsView::OptionsView(QWidget *parent) :
    QGroupBox(parent),
    ui(new Ui::OptionsView)
{
    ui->setupUi(this);

    QObject::connect(ui->start, SIGNAL(clicked()), this, SLOT(startSystem()));
    QObject::connect(ui->changePass, SIGNAL(clicked()), this, SLOT(changePassWord()));
    QObject::connect(ui->create, SIGNAL(clicked()), this, SLOT(createUser()));
    QObject::connect(ui->list, SIGNAL(clicked()), this, SLOT(listUsers()));

}

OptionsView::~OptionsView()
{
    delete ui;
}

void OptionsView::changeEvent(QEvent *e)
{
    QGroupBox::changeEvent(e);
    switch (e->type()) {
    case QEvent::LanguageChange:
        ui->retranslateUi(this);
        break;
    default:
        break;
    }
}

void OptionsView::startSystem()
{
    emit start(true);
}
void OptionsView::changePassWord()
{
    emit changePass(true);
}
void OptionsView::createUser()
{
    emit create(true);
}
void OptionsView::listUsers()
{
    emit listUser(true);
}
